<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="${initProjectVo.packageName}.mapper.PermissionMapper">
    <select id="getPermissionByUserId" resultType="${initProjectVo.packageName}.entity.Permission">
        SELECT
            t3.router_url
        FROM
            t_sys_user_role t1,
            t_sys_role_permission t2,
            t_sys_permission t3
        WHERE
            t1.role_id = t2.role_id
            AND t2.permission_id = t3.id AND <![CDATA[ t3.parent_id <> 0 ]]>
            AND t1.user_id = ${"#"}{userId} AND t3.router_url is  not null
    </select>
</mapper>